Skip to content

feat: continue local history with current API - #1903

Open
undefinted wants to merge 5 commits into
BigPizzaV3:mainfrom
undefinted:feat/continue-local-history-with-current-api
Open

feat: continue local history with current API#1903
undefinted wants to merge 5 commits into
BigPizzaV3:mainfrom
undefinted:feat/continue-local-history-with-current-api

Conversation

@undefinted

@undefinted undefinted commented Aug 19, 2026

Copy link
Copy Markdown

Summary / 概要

  • Add a non-destructive "用当前 API 继续" action for local Codex sessions.
  • 新增非破坏性的「用当前 API 继续」本地会话操作。
  • Fork the source thread through the native Codex app-server protocol.
  • 通过 Codex 原生 app-server 协议 fork 源会话。
  • Preserve the original session and mark the new fork visible in the sidebar.
  • 保留原始会话,并将新 fork 标记为侧边栏可见。
  • Rename each fork to new-<original-title>-<short-thread-id> for clear identification.
  • 将每个 fork 重命名为 new-<原始标题>-<短会话 ID>,便于区分。
  • Resolve Windows CLI execution through the npm codex.cmd shim when available.
  • 在 Windows 上优先通过 npm 的 codex.cmd shim 解析 CLI 执行。
  • Make the session repair action explicit for official login: choosing openai now reads as "显示 API 登录历史" and maps API-provider local history back to the official-login provider.
  • 在官方登录场景下明确暴露历史修复入口:选择 openai 时显示为「显示 API 登录历史」,并将 API provider 的本地历史归到官方登录 provider。

Behavior / 行为

  • Continuing a local session creates an independent thread using the selected model/provider.
  • 继续本地会话时,会使用所选模型/provider 创建一个独立的新会话。
  • Existing scheduled supervision remains attached to the original thread; this change does not duplicate or migrate automations.
  • 已有定时监督仍绑定在原始会话上;此改动不会复制或迁移 automations。
  • Official-login history repair rewrites only local provider ownership metadata so API-key sessions can be opened under the openai provider. It does not copy API keys, merge cloud accounts, or upload local secrets.
  • 官方登录历史修复只改写本地 provider 归属元数据,使 API Key 会话可在 openai provider 下打开;不会复制 API Key、合并云端账号,也不会上传本地密钥。

Validation / 验证

  • npm.cmd test -- --runInBand (66 passed)
  • cargo check -p codex-plus-launcher
  • cargo test -p codex-plus-core --test cdp_bridge (109 passed)
  • git diff --check
  • Added coverage for mapping API-provider history back to official login with run_provider_sync_with_target(..., Some("openai")).
  • 新增测试覆盖:通过 run_provider_sync_with_target(..., Some("openai")) 将 API provider 历史映射回官方登录。
  • Local follow-up validation for the added commit: git diff --cached --check passed before commit; sensitive-pattern scan of the submitted diff found no GitHub credentials, passwords, API keys, server password, or local .codex data.
  • 本次追加提交的本地验证:提交前 git diff --cached --check 通过;提交 diff 的敏感信息扫描未发现 GitHub 凭据、密码、API Key、服务器密码或本地 .codex 数据。

@undefinted
undefinted force-pushed the feat/continue-local-history-with-current-api branch from 34ee009 to ea19b94 Compare August 19, 2026 15:45

@BigPizzaV3 BigPizzaV3 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

成功后,代码先执行重命名并对失败直接 返回,只有重命名成功才设置 。因此只要 暂时不受当前 app-server 支持或超时,就已经创建了 fork,却向界面报告失败且不标记可见;用户重试会继续创建隐藏/重复 fork。建议将“创建并标记可见”作为主事务路径,重命名降级为 warning(或提供可回滚清理),并补充重命名失败不产生重复误导的测试。另外标题先拼接短 ID 再截断 160 字符,长标题会把用于区分的短 ID 截掉,应先为后缀预留长度。

@BigPizzaV3 BigPizzaV3 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thread/fork 成功后,代码先执行重命名并对失败直接返回,只有重命名成功才设置 has_user_event。因此只要 thread/name/set 暂时不受当前 app-server 支持或超时,就已经创建了 fork,却向界面报告失败且不标记可见;用户重试会继续创建隐藏或重复 fork。建议将创建并标记可见作为主路径,重命名降级为 warning,或提供可回滚清理,并补充重命名失败场景的测试。另外标题先拼接短 ID 再截断 160 字符,长标题会把用于区分的短 ID 截掉,应先为后缀预留长度。

@BigPizzaV3
BigPizzaV3 dismissed their stale review August 20, 2026 09:55

重复且不完整的审查记录,保留后续完整审查意见。

@undefinted undefinted closed this Aug 21, 2026
@undefinted undefinted reopened this Aug 21, 2026
…istory-with-current-api

# Conflicts:
#	apps/codex-plus-launcher/src/main.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants